#ifndef _MUTELOCK_H
#define _MUTELOCK_H
#include <pthread.h>

class MutexLock
{
public:
    MutexLock();
    ~MutexLock();
    void lock();
    void unlock();
    pthread_mutex_t *getMutexPtr();

private:
    pthread_mutex_t _mutex;
};
class MutexLockGuard{
public:
MutexLockGuard(MutexLock & mutex)
:_mutex(mutex)
{
    _mutex.lock();
}
~MutexLockGuard(){
    _mutex.unlock();
}

private:
MutexLock & _mutex;
};
#endif
